package com.zhiche.lisa.tms.dao.mapper;


import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.zhiche.lisa.tms.dao.model.Shipment;
import com.zhiche.lisa.tms.vo.ShipmentListInfoVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 装车单 Mapper 接口
 * </p>
 *
 * @author qichao
 * @since 2018-06-18
 */
public interface ShipmentMapper extends BaseMapper<Shipment> {

    /**
     * 根据id获取货物数量
     */
    Integer getItemCountByShipId(@Param("shipId") Long shipId);


    /**
     * 司机分页获取装车单列表
     */
    List<Shipment> getShipmentByPageNoTenant(Page<Shipment> page, @Param("ew") Wrapper<Shipment> ew);

    /**
     * 分页获取装车单列表
     */
    List<Shipment> getShipmentByPage(Page<Shipment> page, @Param("ew") Wrapper<Shipment> ew);


    /**
     * 司机获取装车单
     */
    Shipment getDriverShipmentnotenant(@Param("id") Long id);

    List<Shipment> selectListNotenant(@Param("ew") EntityWrapper<Shipment> sew);

    Shipment selectOneNoTenant(@Param("ew") EntityWrapper<Shipment> shipEW);

    /**
     * 根据运输任务code获取装车单信息
     * @param taskCode 运输任务code
     * @return Shipment
     */
    Shipment selectShipmentByShTaskCode(@Param("taskCode") String taskCode);

    List<Shipment> queryShipDataWms(@Param("ew") EntityWrapper<Shipment> stEW);

    /**
     * 获取装车单及附件信息列表
     * @param page
     * @param ew
     * @return
     */
    List<Shipment> getShipAttachlist(Page<Shipment> page,@Param("ew") EntityWrapper<Shipment> ew);

    /**
     * 查询车队管理员所管理的车队成员任务列表
     * @param page
     * @param ew
     * @return
     */
    List<ShipmentListInfoVo> getShipTaskByFleetId(Page<Shipment> page, @Param("ew") EntityWrapper<Shipment> ew);

    /**
     * 导出车队管理员所管理的车队成员任务列表
     * @param ew
     * @return
     */
    List<ShipmentListInfoVo> exportShipByFleetId(@Param("ew") EntityWrapper<Shipment> ew);

    List<String> queryShipSourceKeys();
}
